<template>
	<view class="page-content">
		<view class="pageMain">
			<project-list v-if="activatedKey == '/pages/project/index'"></project-list>
			<visit-list v-if="activatedKey == '/pages/visit/index'"></visit-list>
			<user-list v-if="activatedKey == '/pages/enterprise/index'"></user-list>
			<personal-center v-if="activatedKey == '/pages/center/index'"></personal-center>
		</view>
		<custom-tabbar :routersArr="routersArr" @changeTabbar="changeTabbar"> </custom-tabbar>
	</view>
</template>

<script setup lang="ts">
	import { onMounted, reactive, ref } from "vue"
	import { onShow } from "@dcloudio/uni-app"
	import projectList from "@/pages/projectList/index.vue"
	import visitList from "@/pages/visitList/index.vue"
	import userList from "@/pages/userList/index.vue"
	import personalCenter from "@/pages/personalCenter/index.vue"
	import customTabbar from "@/components/customTabbar/index.vue"
	import { routers } from "@/api/app/index"
	import { userInfo } from "@/api/app/index"
	import type { Router } from "@/types/system"
	
	
	//路由
	let routersArr = ref<Router[]>([])
	
	//navbar当前处于高亮的Key
	let activatedKey = ref<string>('')
	
	//切换changeTabbar
	let changeTabbar = (index: string): void => {
		activatedKey.value = index
	}
	
</script>

<style lang="scss" scoped>
	.page-content{
		width: 100%;
		height: 100%;
		.pageMain{
			width: 100%;
			height: calc(100% - 140rpx);
			box-sizing: border-box;
			overflow: hidden;
		}
	}

</style>